<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>

<head>
    <%@include file="../system/head.jsp"%>
    <title>订单详情</title>

    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/webbase.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/pages-seckillOrder.css" />

</head>

<body>
<!-- 头部栏位 -->
<!--页面顶部-->
<%@include file="../system/header.jsp"%>

<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/jquery/jquery.min.js"></script>
<script type="text/javascript">
    $(function(){
        $("#service").hover(function(){
            $(".service").show();
        },function(){
            $(".service").hide();
        });
        $("#shopcar").hover(function(){
            $("#shopcarlist").show();
        },function(){
            $("#shopcarlist").hide();
        });

    })
</script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/jquery.easing/jquery.easing.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/sui/sui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/jquery-placeholder/jquery.placeholder.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/js/widget/nav.js"></script>
<script>
    $(function () {
        var username = '${Username}';
        if(username === ''){
            $("#showUsername").html("请<a href=\"${pageContext.request.contextPath}/system/login\">登录</a>\n" +
                "                            <span><a href=\"${pageContext.request.contextPath}/system/register\">免费注册</a></span>")
        }else{
            $("#showUsername").html(""+username+" <a href='${pageContext.request.contextPath}/login/logout'>退出登录</a>");
        }
    });
</script>
</body>
<!--header-->
<div id="account">
    <div class="py-container">
        <div class="yui3-g home">
            <!--左侧列表-->
            <div class="yui3-u-1-6 list">
                <div class="list-items">
                    <dl>
                        <dt><i>·</i> 订单中心</dt>
                        <dd ><a href="${pageContext.request.contextPath}/system/toHome?username=${Username}&currentPage=1">我的订单</a></dd>
                        <dd><a href="${pageContext.request.contextPath}/system/toOrderList?username=${Username}&order_status=0&currentPage=1" >待付款</a></dd>
                        <dd><a href="${pageContext.request.contextPath}/system/toOrderList?username=${Username}&order_status=1&currentPage=1"  >待发货</a></dd>
                        <dd><a href="${pageContext.request.contextPath}/system/toOrderList?username=${Username}&order_status=2&currentPage=1" >待收货</a></dd>
                    </dl>
                    <dl>
                        <dt><i>·</i> 我的中心</dt>
                        <dd><a href="${pageContext.request.contextPath}/goods/toCollect?username=${Username}&currentPage=1">我的收藏</a></dd>                    </dl>
                    <dl>
                        <dt><i>·</i> 设置</dt>
                        <dd><a href="${pageContext.request.contextPath}/system/toAddress?username=${Username}"  >地址管理</a></dd>                    </dl>
                </div>
            </div>
            <div class="yui3-u-5-6">
                <div class="body">
                    <div class="order-detail">
                        <h4>订单详情</h4>
                        <div class="order-state">
                            <c:if test="${order.orders.get(0).order_status == 0}">
                                <p>当前订单状态：<span class="red">待付款</span></p>
                            </c:if>
                            <c:if test="${order.orders.get(0).order_status == 1}">
                                <p>当前订单状态：<span class="red">待发货</span></p>
                            </c:if>
                            <c:if test="${order.orders.get(0).order_status == 2}">
                                <p>当前订单状态：<span class="red">待收货</span></p>
                            </c:if>
                            <c:if test="${order.orders.get(0).order_status == 3}">
                                <p>当前订单状态：<span class="red">已完成</span></p>
                            </c:if>
                        </div>
                    </div>
                    <div class="order-info">
                        <h5>订单信息</h5>
                        <p>收件人：${order.orders.get(0).address.realName}  </p>
                        <p>收货地址：${order.orders.get(0).address.address}  </p>
                        <p>订单单号：${order.orders.get(0).order_num}</p>
                        <p>下单时间：${order.orders.get(0).create_time}</p>
                        <p>支付时间：${order.orders.get(0).paid_time}</p>
                        <p>支付方式：支付宝</p>
                    </div>
                    <div class="order-goods">
                        <table class="sui-table">
                            <thead>
                            <th class="center" >商品</th>
                            <th class="center" >价格</th>
                            <th class="center" >数量</th>
                            <th class="center" >优惠</th>
                            <th class="center" >状态</th>
                            </thead>

                            <tbody>
                            <tr>
                                <td colspan="5">订单编号：${order.orders.get(0).order_num}</td>
                            </tr>
                            <c:forEach items="${order.orders}" var="item">
                            <tr>
                                <td>
                                    <div class="typographic"><img width="10%" src="${item.goods.image1}" />
                                        <span>${item.goods.goods_name}</span>
                                    </div>
                                </td>
                                <td>
                                    <ul class="unstyled">
                                        <li>￥${item.goods.goods_price}</li>
                                    </ul>
                                </td>
                                <td>${item.buy_counts}</td>
                                <td>无优惠</td>
                                <td>
                                    <c:if test="${order.orders.get(0).order_status == 0}">
                                        待付款
                                    </c:if>
                                    <c:if test="${order.orders.get(0).order_status == 1}">
                                        待发货
                                    </c:if>
                                    <c:if test="${order.orders.get(0).order_status == 2}">
                                        待收货
                                    </c:if>
                                    <c:if test="${order.orders.get(0).order_status == 3}">
                                        已完成
                                    </c:if>
                                </td>
                            </tr>
                            </c:forEach>
                            </tbody>
                        </table>

                        <div class="order-price">
                            <p>商品总金额：￥${totalPrice}</p>
                            <p>运费金额：免费用</p>
                            <p>使用优惠券：无</p>
                            <h4 class="red">实际支付：￥${totalPrice}</h4>
                        </div>
                        <div class="clearfix"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 底部栏位 -->
<!--页面底部-->
<%@include file="../system/Footer.jsp"%>
    <!--页面底部END-->
    <!-- 楼层位置 -->

    <script type="text/javascript">
        $(function(){
            $("#service").hover(function(){
                $(".service").show();
            },function(){
                $(".service").hide();
            });
            $("#shopcar").hover(function(){
                $("#shopcarlist").show();
            },function(){
                $("#shopcarlist").hide();
            });

        })
    </script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/model/cartModel.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/czFunction.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/jquery.easing/jquery.easing.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/plugins/sui/sui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/pages/index.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/widget/cartPanelView.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/widget/jquery.autocomplete.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/js/widget/nav.js"></script>
<!--页面底部END-->
undefined

</html>